const jwt = require('jsonwebtoken');
const serect = 'bimiyeyou';  //密钥，不能丢
module.exports =  (tokens) => {
  if(tokens){
      return new Promise((resolve, reject) =>{
        jwt.verify(tokens, serect, (error, decoded) => { 
            if(error){
              resolve({conf:false,infor:error.message})
            }else{
              resolve({conf:true,infor:decoded});
            }
        })
    })
  }else{
     return false
  }
};